﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Upeu.Venta.Data.Business;
using Upeu.Venta.Data.Entities;

namespace Upeu.Venta.Data.Test.Business
{
    [TestClass]
    public class PersonaBusinessTest
    {
        [TestMethod]
        public void TestGetListByFilter()
        {
            var lista = PersonaBusiness.GetListByFilter("");
            Assert.IsTrue(lista.Count > 0);
        }

        [TestMethod]
        public void TestCreate()
        {
            Persona nuevo = new Persona
            {
                Nombre = "Miguel",
                Apell_paterno = "Quispe",
                Apell_materno = "Merma",
                Dni = 754632,
                Sexo = "M",
                Direccion = "juliaca",
                Celular = 8779887,
                Fecha_nacimiento = DateTime.Now

            };
            Persona c = PersonaBusiness.Create(nuevo);
            Assert.IsTrue(c.IdPersona != Guid.Empty);
        }

        [TestMethod]
        public void TestUpdate()
        {
            Persona nuevo = new Persona
            {
                IdPersona = new Guid("17f1f0b2-99df-e411-84bc-e069958900b1"),
                Nombre = "Omar",
                Apell_paterno = "Quenta",
                Apell_materno = "Merma",
                Dni = 7654632,
                Sexo = "M",
                Direccion = "puno",
                Celular = 957577758,
                Fecha_nacimiento = DateTime.Now

            };
            Persona c = PersonaBusiness.Update(nuevo);
            Assert.IsTrue(c.IdPersona != Guid.Empty);
        }
    }
}
